package com.lc.demo.service.impl;

import com.lc.demo.bean.Order;
import com.lc.demo.mapper.OrderMapper;
import com.lc.demo.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: sakila
 * @Date: 2022/03/07/20:49
 * @Description:
 */

@Service
public class OrderServiceImpl implements OrderService {

    @Autowired
    private OrderMapper orderMapper;

    @Override
    public List<Order> selectOrderList(Integer id) {
        return orderMapper.selectOrderList(id);
    }

    @Override
    public void insertOrder(Order order) {
        orderMapper.insert(order);
    }

    @Override
    public void updateOrderStatus(Integer id) {
        Order order = new Order();
        order.setId(id);
        order.setStatus(1);
        orderMapper.updateByPrimaryKeySelective(order);
    }
}
